using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerAnimation : MonoBehaviour
{
    private Rigidbody2D m_Rigidbody2D;
    private PlayerMovement m_PlayerMovement;

    void Start()
    {
        m_Rigidbody2D = GetComponent<Rigidbody2D>();
        m_PlayerMovement = GetComponent<PlayerMovement>();
    }

    void Update()
    {
        var velocity = m_Rigidbody2D.velocity;
        float val = 0.3f * Mathf.Abs(velocity.x / m_PlayerMovement.m_MoveHorizontalSpeed);
        var scale = new Vector3(1f+ val,1f,1f);
        transform.localScale = scale;
    }
}
